from flask import Flask
from flask import render_template

app = Flask(__name__)


@app.route("/mulu/")
def mulu():
    mulu_list = ["玄幻", "都市", "武侠", "悬疑", "历史"]
    return render_template("catalog.html", **locals())


@app.route("/mulu/xuanhuan/")
def xuanhuan():
    xuanhuan_list = [
        {"book_name": "《斗罗大陆》", "author": "唐家三少"},
        {"book_name": "《武动乾坤》", "author": "天蚕土豆"},
        {"book_name": "《完美世界》", "author": "辰东"},
        {"book_name": "《将夜》", "author": "猫腻"},
        {"book_name": "《大主宰》", "author": "天蚕土豆"}
    ]
    return render_template("fantasy.html", **locals())

@app.route("/mulu/dushi/")
def dushi():
    dushi_list = [
        {"book_name": "《第一序列》", "author": "会说话的肘子"},
        {"book_name": "《我的1979》", "author": "争斤论两花花帽"},
        {"book_name": "《坏蛋是怎么炼成的》", "author": "六道"},
        {"book_name": "《修真聊天群》", "author": "圣骑士的传说"},
        {"book_name": "《同桌凶猛》", "author": "柳下挥"}
    ]
    return render_template("city.html", **locals())


@app.route("/mulu/wuxia/")
def wuxia():
    wuxia_list = [
        {"book_name": "《九鼎记》", "author": "我吃西红柿"},
        {"book_name": "《白袍总管》", "author": "萧舒"},
        {"book_name": "《通幽大圣》", "author": "封七月"},
        {"book_name": "《逍遥派》", "author": "白马出淤泥"},
        {"book_name": "《执剑写春秋》", "author": "殊彦"}
    ]
    return render_template("martial.html", **locals())


@app.route("/mulu/xuanyi/")
def xuanyi():
    xuanyi_list = [
        {"book_name": "《深夜书屋》", "author": "纯洁滴小龙"},
        {"book_name": "《盗墓笔记》", "author": "南派三叔"},
        {"book_name": "《鬼吹灯》", "author": "本物天下霸唱"},
        {"book_name": "《诡神冢》", "author": "焚天孔雀"},
        {"book_name": "《镇墓兽》", "author": "蔡骏"}
    ]
    return render_template("suspense.html", **locals())


@app.route("/mulu/lishi/")
def lishi():
    lishi_list = [
        {"book_name": "《回到明朝当王爷》", "author": "月关"},
        {"book_name": "《庆余年》", "author": "猫腻"},
        {"book_name": "《锦衣夜行》", "author": "月关"},
        {"book_name": "《大魏宫廷》", "author": "贱宗首席弟子"},
        {"book_name": "《大汉帝国风云录》", "author": "猛子"}
    ]
    return render_template("history.html", **locals())


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=8000, debug=True)
